﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using SMSSnew.DATA.CLASSES;

namespace SMSSnew.UI.vicePrincipal.timetable.dataEntry
{
    public partial class vicePrinDeleteSubject : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                subjectSubTypesCLZ objTT = new subjectSubTypesCLZ();

                DataTable dt1;

                dt1 = objTT.LoadGradeID();

                if (dt1.Rows.Count != 0)
                {
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        cboGradeID.Items.Insert(i, dt1.Rows[i][0].ToString());
                    }
                }

            }
        }

        protected void cboGradeID_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt2;
            subjectSubTypesCLZ objClass = new subjectSubTypesCLZ(cboGradeID.SelectedItem.ToString());
            subjectSubTypesCLZ objTT = new subjectSubTypesCLZ();
            dt2 = objTT.LoadSubjectCode(objClass);

            cboSubjectCode.Items.Clear();

            if (dt2.Rows.Count != 0)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    cboSubjectCode.Items.Insert(i, dt2.Rows[i][0].ToString());
                }
            }
        }
        protected void cboSubjectCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt2;
            subjectSubTypesCLZ objClass = new subjectSubTypesCLZ(cboSubjectCode.SelectedItem.ToString());
            subjectSubTypesCLZ objTT = new subjectSubTypesCLZ();
            dt2 = objTT.LoadSubjectTypeID(objClass);

            cboSubjectTypeID.Items.Clear();

            if (dt2.Rows.Count != 0)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    cboSubjectTypeID.Items.Insert(i, dt2.Rows[i][0].ToString());
                }
            }
        }


        protected void btnDelete_Click(object sender, EventArgs e)
        {
            subjectSubTypesCLZ delete = new subjectSubTypesCLZ();

            delete.deleteSubjectDetails(cboGradeID.SelectedItem.ToString(),
                cboSubjectCode.SelectedItem.ToString(), cboSubjectTypeID.SelectedItem.ToString());



        }
    }
}

